#include<p33fxxxx.h>
#include<stdio.h>

unsigned int REF_V=50 // REF_V*100
unsigned int KP_V=8000;		// MAX 2^15 -1= 32767
unsigned int KI_V=4500;		// MAX 2^15 -1= 32767
unsigned int KD_V=10000;	// MAX 2^15 -1= 32767

void INITIAL_PID(void)
{
	PHASE1=PID_OUT;
}


void PID_calculate(void)
{
	PID_TIMER=PID_TIMER++;
	if(PID_TIMERbits.2==1)
		break;
	else
		PID_TIMER=0;
}